import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  final List<String> items;

  MyApp({Key key, this.items}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new MaterialApp(
      title: "flutte demo",
      home: Scaffold(
          appBar: new AppBar(
            title: new Text("flutter world"),
          ),
          body: GridView(
            padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: 3,
              mainAxisSpacing: 2.0,//列间距
              crossAxisSpacing: 4.0,//行间距
              childAspectRatio: 1.2, //横竖比
            ),
            children: <Widget>[
              new Image.network(
                "http://img51.photophoto.cn/20190514/0017030011758117_s.jpg",
                fit: BoxFit.cover,
              ),
              new Image.network(
                "http://img51.photophoto.cn/20190514/0017030011758117_s.jpg",
                fit: BoxFit.cover,
              ),
              new Image.network(
                "http://img51.photophoto.cn/20190514/0017030011758117_s.jpg",
                fit: BoxFit.cover,
              ),
              new Image.network(
                "http://img51.photophoto.cn/20190514/0017030011758117_s.jpg",
                fit: BoxFit.cover,
              ), new Image.network(
                "http://img51.photophoto.cn/20190514/0017030011758117_s.jpg",
                fit: BoxFit.cover,
              ), new Image.network(
                "http://img51.photophoto.cn/20190514/0017030011758117_s.jpg",
                fit: BoxFit.cover,
              ),
            ],
          )),
    );
  }
}
